/*
 * DxfLINE.java
 *
 * Created on 6 de Dezembro de 2007, 10:32
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package importadorDXF;

import mathematics.Point3D;

/**
 *
 * @author rafaelbuck
 */
public class DxfLINE extends DxfEntity
{

    /** Creates a new instance of DxfLINE */
    public DxfLINE()
    {
        end = new Point3D[2];
        end[0] = new Point3D();
        end[1] = new Point3D();
    }

    public boolean setGroup(short grpNr, float fval)
    {
        switch(grpNr)
        {
        case 10: // '\n'
        case 11: // '\013'
        case 20: // '\024'
        case 21: // '\025'
        case 30: // '\036'
        case 31: // '\037'
            setCoord(end[grpNr % 10], grpNr / 10, fval);
            return true;
        }
        return super.setGroup(grpNr, fval);
    }

    public void convert(DxfConverter converter, DxfFile dxf, Object collector)
    {
        converter.convert(this, dxf, collector);
    }

    public final Point3D getStartPoint()
    {
        return end[0];
    }

    public final Point3D getEndPoint()
    {
        return end[1];
    }

    protected Point3D end[];
}